import 'dart:convert';

import 'package:flutter2/generated/json/base/json_field.dart';
import 'package:flutter2/generated/json/product_entity.g.dart';

export 'package:flutter2/generated/json/product_entity.g.dart';

@JsonSerializable()
class ProductEntity {
  @JSONField(name: "uturkey")
  List<ProductDetail> details = [];
  @JSONField(name: "blankfollowsharpen")
  int pid = 0;

  ProductEntity();

  factory ProductEntity.fromJson(Map<String, dynamic> json) => $ProductEntityFromJson(json);

  Map<String, dynamic> toJson() => $ProductEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class ProductDetail {
  @JSONField(name: "word")
  int duration = 0;
  @JSONField(name: "kindsheetmake")
  int period = 0;
  @JSONField(name: "areboilruin")
  int detailId = 0;
  @JSONField(name: "entertainmentaccountinsixth")
  int min = 0;
  @JSONField(name: "assumeagobutton")
  int max = 0;
  @JSONField(name: "frenchcirculate")
  int internal = 0;

  ProductDetail();

  factory ProductDetail.fromJson(Map<String, dynamic> json) => $ProductDetailFromJson(json);

  Map<String, dynamic> toJson() => $ProductDetailToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
